package com.qf.springboot2.conditions;

import com.qf.springboot2.pojo.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BeanConfig {

    @Bean

    //通过@Conditional注解，使用条件判断，当条件成立时，这个对象就会注入到Spring ioc中，反之不注入
//    @Conditional(StuCondition.class)

    @PropertyCondition(useStu = true)
    public Student stu(){
        return new Student();
    }
}
